import service from '@/utils/request/index'
import { ResType, GetInfo, GaolanResType, VideoListDTO, MonitorDTO } from './types'

export const getAllMonitorName = () => {
  return service.post<MonitorDTO>('/api/gaolan-service-wisdom-safe//safeManage/allMonitorName')
}

export const getVideoList2 = () => {
  return service.post('/api/gaolan-service-wisdom-safe/hikVideoController/selectMonitor', {})
}

export const getVideoList = (params:any) => {
  return service.post<VideoListDTO>('/api/gaolan-service-wisdom-safe/hikVideoController/selectMonitor', params)
}

export const getVideoUrl = (url: string) => {
  return service.get<GaolanResType>(`/api/gaolan-service-wisdom-safe/hikVideoController/previewHikVideoWSUrl?cameraIndexCode=${url}`)
}

export const getInfo = () => {
  // return service({
  //   method: 'GET',
  //   url: '/dyh1110/vue3-demo/contributors_count?ref=master'
  // })

  // return service.get<ResType>('/dyh1110/vue3-demo/contributors_count?ref=master')
  return service.get<ResType<GetInfo>>('/dyh1110/vue3-demo/contributors_count?ref=master')

  // return service<ResType<GetInfo>>({
  //   method: 'GET',
  //   url: '/dyh1110/vue3-demo/contributors_count?ref=master'
  // })
}

export const getBlobTypeData = () => {
  // return service<Blob>({
  //   method: 'GET',
  //   url: '请求链接',
  //   params: {
  //     stamp: Date.now()
  //   },
  //   responseType: 'blob'
  // })
  return service.get<Blob>('/dyh1110/vue3-demo/contributors_count?ref=master', { params: { stamp: Date.now() }, responseType: 'blob' })
}
